package com.bjbn;

import com.bjbn.service.BmsDataService;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * BMS API 主启动类
 */
@Slf4j
@SpringBootApplication
@EnableScheduling
@MapperScan("com.bjbn.mapper")
public class BmsApplication implements CommandLineRunner {
    
    @Autowired
    private BmsDataService bmsDataService;
    
    public static void main(String[] args) {
        SpringApplication.run(BmsApplication.class, args);
    }
    
    @Override
    public void run(String... args) throws Exception {
       /* log.info("BMS API 启动完成，开始初始化数据同步...");
        
        try {
            // 启动时同步设备分组数据
            log.info("启动时同步设备分组数据开始");
            bmsDataService.processDeviceGroupData();
            log.info("启动时同步设备分组数据完成");
            
            // 启动时同步设备信息数据
            log.info("启动时同步设备信息数据开始");
            bmsDataService.processDeviceInfoData();
            log.info("启动时同步设备信息数据完成");
            
            log.info("BMS API 初始化数据同步完成");
        } catch (Exception e) {
            log.error("BMS API 初始化数据同步异常", e);
        }*/
    }
} 